<?php /* Smarty version 2.6.18, created on 2012-10-11 20:35:31
         compiled from modules/viewprod.tpl */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'stripslashes', 'modules/viewprod.tpl', 56, false),array('modifier', 'price_format', 'modules/viewprod.tpl', 84, false),array('modifier', 'md5', 'modules/viewprod.tpl', 90, false),)), $this); ?>
<?php echo ' 
<script type="text/javascript">
	$(document).ready(function(){
		$(".additionalImage").click(changeImage);
		calculateItem();						 
	});

	function  calculateSingle(id){
		$(id +\':checked\').not(this).removeAttr(\'checked\');
  		calculateItem();
	}

	function changeImage(){
  		var url = $(this).attr(\'src\');
  		$("#mainImage").attr("src", url);
	}
</script>
'; ?>


<table width="100%" border="0" cellspacing="3" cellpadding="3">
  <tr>
    <td>
    	<div id="viewprod">
    		<form id="itemform" action="ajax.php?function=add-post" method="GET">
    			<div id="productImages">
      			<div id="mainImageContainer">
        				<?php if ($this->_tpl_vars['item_image'] != ""): ?>
          				<img id="mainImage" draggable="false" src="UserFiles/Image/product_photos/thumbs/<?php echo $this->_tpl_vars['item_image']; ?>
" />
        				<?php else: ?>
          				<img id="mainImage" src="images/no_image.gif" />
        				<?php endif; ?>
      			</div>

      			<?php if ($this->_tpl_vars['additional_images']['0']['id'] != ""): ?>
        				<div id="additionalImages">
          				<img class="additionalImage" draggable="false" src="UserFiles/Image/product_photos/thumbs/<?php echo $this->_tpl_vars['item_image']; ?>
"/>
          				
          				<?php $_from = $this->_tpl_vars['additional_images']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['ae']):
?>
            				<img class="additionalImage" draggable="false" src="UserFiles/Image/product_photos/thumbs/<?php echo $this->_tpl_vars['ae']['value']; ?>
"/>
          				<?php endforeach; endif; unset($_from); ?>
        				</div>
      			<?php endif; ?>
    			</div>

    			<div class="itemInfo">
      			<h1><?php echo $this->_tpl_vars['item_name']; ?>
</h1>
      			<?php echo $this->_tpl_vars['item_desc']; ?>


      			<div class="quantity" >
        				<b><?php echo $this->_tpl_vars['lang']['cart_quantity_label']; ?>
</b>
        				<input type="text" value="1" name="quantity" size="2" id="quantity" />         
      			</div>
					
					<?php $_from = $this->_tpl_vars['newoptions']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['opt']):
?>
        				<div class="option_set">
          				<span class="name"><?php echo ((is_array($_tmp=$this->_tpl_vars['opt']['name'])) ? $this->_run_mod_handler('stripslashes', true, $_tmp) : stripslashes($_tmp)); ?>
</span>
          				<?php if ($this->_tpl_vars['opt']['max_toppings'] == 0 && $this->_tpl_vars['opt']['min_toppings'] == 0): ?>
            				          				<?php else: ?>
            				<?php if ($this->_tpl_vars['opt']['max_toppings'] != ""): ?>
              					<span class="max_toppings"><?php echo $this->_tpl_vars['lang']['viewprod_option_choose_max']; ?>
&nbsp;<?php echo $this->_tpl_vars['opt']['max_toppings']; ?>
</span>
            				<?php endif; ?>
            				
            				<?php if ($this->_tpl_vars['opt']['min_toppings'] != ""): ?>
              					<span class="max_toppings"><?php echo $this->_tpl_vars['lang']['viewprod_option_choose_min']; ?>
&nbsp;<?php echo $this->_tpl_vars['opt']['min_toppings']; ?>
</span>
            				<?php endif; ?>
          				<?php endif; ?> 
          			
          				<div class="optionlist">     
								<?php if ($this->_tpl_vars['opt']['min_toppings'] == ""): ?> 									<?php $_from = $this->_tpl_vars['opt']['options']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['opt_item']):
?>
              						<span class="optionchecks">
                						<input type="checkbox" name="options[]" value="(<?php echo $this->_tpl_vars['opt']['name']; ?>
: <?php echo $this->_tpl_vars['opt_item']['name']; ?>
),<?php echo $this->_tpl_vars['opt_item']['price']; ?>
" 
                  						<?php if ($this->_tpl_vars['opt']['multi'] == 0): ?>  
                    							onclick="checkSet('<?php echo $this->_tpl_vars['opt']['max_toppings']; ?>
','<?php echo $this->_tpl_vars['opt']['id']; ?>
','option_<?php echo $this->_tpl_vars['opt_item']['id']; ?>
');calculateSingle('.unique_<?php echo $this->_tpl_vars['opt']['id']; ?>
')"
                  						<?php else: ?>
                    							onclick="checkSet('<?php echo $this->_tpl_vars['opt']['max_toppings']; ?>
','<?php echo $this->_tpl_vars['opt']['id']; ?>
','option_<?php echo $this->_tpl_vars['opt_item']['id']; ?>
');calculateItem()"
                  						<?php endif; ?> 
                  						class="optionset_<?php echo $this->_tpl_vars['opt']['id']; ?>
 option_<?php echo $this->_tpl_vars['opt_item']['id']; ?>
<?php if ($this->_tpl_vars['opt']['multi'] == 0): ?>unique_<?php echo $this->_tpl_vars['opt']['id']; ?>
<?php endif; ?>"
                					/> 
                					
                					<?php echo ((is_array($_tmp=$this->_tpl_vars['opt_item']['name'])) ? $this->_run_mod_handler('stripslashes', true, $_tmp) : stripslashes($_tmp)); ?>
 
                					<?php if ($this->_tpl_vars['opt_item']['price'] != 0 && $this->_tpl_vars['opt_item']['price'] != ""): ?>
                						<em style="color:green">+<?php echo ((is_array($_tmp=$this->_tpl_vars['opt_item']['price'])) ? $this->_run_mod_handler('price_format', true, $_tmp) : smarty_modifier_price_format($_tmp)); ?>
</em>
                					<?php endif; ?>
              						</span>  
            					<?php endforeach; endif; unset($_from); ?>
            				<?php elseif ($this->_tpl_vars['opt']['min_toppings'] == 1 && $this->_tpl_vars['opt']['max_toppings'] == 1): ?> 
            													<select class="options <?php echo ((is_array($_tmp=$this->_tpl_vars['opt']['name'])) ? $this->_run_mod_handler('md5', true, $_tmp) : md5($_tmp)); ?>
" >
            						<?php $_from = $this->_tpl_vars['opt']['options']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['opt_item']):
?>
              							<option value="<?php echo $this->_tpl_vars['opt_item']['price']; ?>
">
              								<?php echo $this->_tpl_vars['opt_item']['name']; ?>
 
              								<?php if ($this->_tpl_vars['opt_item']['price'] != 0 && $this->_tpl_vars['opt_item']['price'] != ""): ?>
              									(<?php echo ((is_array($_tmp=$this->_tpl_vars['opt_item']['price'])) ? $this->_run_mod_handler('price_format', true, $_tmp) : smarty_modifier_price_format($_tmp)); ?>
)
              								<?php endif; ?>
              							</option>
            						<?php endforeach; endif; unset($_from); ?>
            					</select>
            					
            					<?php echo '
            					<script type="text/javascript" >
              						$(function(){
            					'; ?>

                						var $select = $('.options.<?php echo ((is_array($_tmp=$this->_tpl_vars['opt']['name'])) ? $this->_run_mod_handler('md5', true, $_tmp) : md5($_tmp)); ?>
');
            					<?php echo '
                						$select.bind(\'change\',calculateItem);
                						$select[0].selectedIndex[0] = 0;
                						$select.trigger(\'change\');
              							});
            					</script>
            					'; ?>


				          <?php else: ?>        						<?php $_from = $this->_tpl_vars['opt']['options']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['opt_item']):
?>
               				<div class="optioninputs">
                 					<span>
				                  	<?php echo ((is_array($_tmp=$this->_tpl_vars['opt_item']['name'])) ? $this->_run_mod_handler('stripslashes', true, $_tmp) : stripslashes($_tmp)); ?>
 
                   				
                   					<?php if ($this->_tpl_vars['opt_item']['price'] != 0 && $this->_tpl_vars['opt_item']['price'] != ""): ?>
                     					(<?php echo ((is_array($_tmp=$this->_tpl_vars['opt_item']['price'])) ? $this->_run_mod_handler('price_format', true, $_tmp) : smarty_modifier_price_format($_tmp)); ?>
)
                   					<?php endif; ?>
                 					</span>
                 					
                 					<input type="text" value="0"  size="3" name="min_option[<?php echo $this->_tpl_vars['opt_item']['name']; ?>
|<?php echo $this->_tpl_vars['opt_item']['price']; ?>
]" data-price="<?php echo $this->_tpl_vars['opt_item']['price']; ?>
" onkeyup="calculateItem();" oninput="calculateItem();" />  
               				</div>  
             				<?php endforeach; endif; unset($_from); ?>  
             			<?php endif; ?>           			</div>
      			</div>
      		<?php endforeach; endif; unset($_from); ?>
      		
      		<div id="totalprice">
        			<span class="label"><?php echo $this->_tpl_vars['lang']['cart_price_label']; ?>
</span>
        			<span id="item_price" ><?php echo $this->_tpl_vars['current_price']; ?>
</span>
      		</div>  

      		<input class="submit" type="submit" value="<?php echo $this->_tpl_vars['lang']['cart_add_button']; ?>
" onClick="Dialog('#thankyou','350','150');<?php if ($this->_tpl_vars['config']['popup'] == 1): ?>closeDialog();<?php endif; ?>return false;" id="add-cart">
    		</div>
    		
    		<div style="clear:both"></div>
			
			<div class="instructions" > 
		      <p><?php echo $this->_tpl_vars['lang']['cart_special_instructions_label']; ?>
</p>
		      <textarea name="instructions" ></textarea>
    		</div>
			
			<input type="hidden" id="final_price" name="final_price" value="<?php echo $this->_tpl_vars['current_price_nf']; ?>
" />
    		<input type="hidden" id="final_options" name="final_options" />
    		<input type="hidden" id="final_price_type" name="final_price_type" />
    
    		<input type="hidden" name="desc" value="<?php echo $this->_tpl_vars['item_desc']; ?>
">
    		<input type="hidden" name="name" value="<?php echo $this->_tpl_vars['item_name']; ?>
">
   		<input type="hidden" name="cat" value="<?php echo $this->_tpl_vars['item_cat']; ?>
">
    		<input type="hidden" name="id" value="<?php echo $this->_tpl_vars['item_id']; ?>
">
    	</form>
    	
    	<div style="display:none">
    		<div id="thankyou" title="<?php echo $this->_tpl_vars['lang']['cart_added_to_cart']; ?>
">
    			<p><?php echo $this->_tpl_vars['item_name']; ?>
 <?php echo $this->_tpl_vars['lang']['cart_added']; ?>
</p>
	    	</div>
  		</div>

  		<div id="add-cart">
    		<div id="message"></div>
  		</div>
	</div>
	&nbsp;
</td>
</tr>
</table>